package org.fingersnow.dbdictionary;

import java.io.IOException;
import java.net.URISyntaxException;
import org.fingersnow.dbdictionary.dto.DataBase;
import freemarker.template.TemplateException;

public class CreateWordMain {

	private static String AUTHOR = "丁永标";
	private static String VERSION = "V1.4";
	private static String FILENAME = "dbStructure.json";

	public static void main(String[] args) throws URISyntaxException, IOException, TemplateException {
		long start = System.currentTimeMillis();
		DataBase db = Json2DataBase.getDataBase(AUTHOR, VERSION, FILENAME);
		// 生成word
		new Template2Word(null, "D:/数据库字典" + db.getVersion() + "_" + db.getDate() + ".docx", db).templateToCreateWord();
		// 生成excel
		new Template2Excel("D:/数据库字典" + db.getVersion() + "_" + db.getDate() + ".xlsx", db).templateToCreateExcel();
		
		long end = System.currentTimeMillis();
		System.out.println("end. 花费时间:" + (end-start)/1000.00 + "s.");
	}

}
